﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Dycox.Collections;

namespace Dycox.Reporting
{
    public class DataSheetRow
    {
        public DataSheetRow()
        {
            _cells = new DataSheetCellCollection(this);
        }

        private DataSheet _sheet;

        public DataSheet Sheet
        {
            get { return _sheet; }
            internal set { _sheet = value; }
        }

        private DataSheetCellCollection _cells;

        public DataSheetCellCollection Cells
        {
            get { return _cells; }
        }

    }

    public class DataSheetRowCollection : OwnedCollection<DataSheetRow, DataSheet>
    {
        public DataSheetRowCollection(DataSheet sheet)
            : base(sheet)
        {

        }

        protected override void SetItemOwner(DataSheetRow item, DataSheet owner)
        {
            item.Sheet = owner;
        }

        protected override DataSheet GetItemOwner(DataSheetRow item)
        {
            return item.Sheet;
        }
    }
}
